<div class="companies view indexOnly">
  <h2><?php echo __('Detalle de Transporte "').h($company['Company']['social_razon']).'"'; ?></h2>
  <dl>

    <dt><?php echo __('Nombre:'); ?></dt>
    <dd>
      <?php echo h($company['Company']['social_razon']); ?>
      &nbsp;
    </dd>
    <dt><?php echo __('Ciudad:'); ?></dt>
    <dd>
      <?php echo h($company['Company']['city']); ?>
      &nbsp;
    </dd>
    <dt><?php echo __('Dirección:'); ?></dt>
    <dd>
      <?php echo h($company['Company']['address']); ?>
      &nbsp;
    </dd>
    <dt><?php echo __('Email:'); ?></dt>
    <dd>
      <?php echo h($company['Company']['email']); ?>
      &nbsp;
    </dd>
    <dt><?php echo __('Saldo:'); ?></dt>




    <?php if ($company['Company']['saldo'] >= 0) : ?>
      <dd>
      <?php else : ?>
      <dd class="negative_saldo">
      <?php endif; ?>

      <b> <?php echo h($company['Company']['saldo']); ?> </b>  &nbsp;










    </dd>
    <dt><?php echo __('Telefono'); ?></dt>
    <dd>
      <?php echo h($company['Company']['phone']); ?>
      &nbsp;
    </dd>
    <dt><?php echo __('Cuit'); ?></dt>
    <dd>
      <?php echo h($company['Company']['cuit']); ?>
      &nbsp;
    </dd>
  </dl>
</div>
<div class="actions" style="display: none">
  <h3><?php echo __('Actions'); ?></h3>
  <ul>
    <li><?php echo $this->Html->link(__('Edit Company'), array('action' => 'edit', $company['Company']['id'])); ?> </li>
    <li><?php echo $this->Form->postLink(__('Delete Company'), array('action' => 'delete', $company['Company']['id']), null, __('Are you sure you want to delete # %s?', $company['Company']['id'])); ?> </li>
    <li><?php echo $this->Html->link(__('List Companies'), array('action' => 'index')); ?> </li>
    <li><?php echo $this->Html->link(__('New Company'), array('action' => 'add')); ?> </li>
    <li><?php echo $this->Html->link(__('List Coupleds'), array('controller' => 'coupleds', 'action' => 'index')); ?> </li>
    <li><?php echo $this->Html->link(__('New Coupled'), array('controller' => 'coupleds', 'action' => 'add')); ?> </li>
    <li><?php echo $this->Html->link(__('List Drivers'), array('controller' => 'drivers', 'action' => 'index')); ?> </li>
    <li><?php echo $this->Html->link(__('New Driver'), array('controller' => 'drivers', 'action' => 'add')); ?> </li>
    <li><?php echo $this->Html->link(__('List Orders'), array('controller' => 'orders', 'action' => 'index')); ?> </li>
    <li><?php echo $this->Html->link(__('New Order'), array('controller' => 'orders', 'action' => 'add')); ?> </li>
    <li><?php echo $this->Html->link(__('List Vehicles'), array('controller' => 'vehicles', 'action' => 'index')); ?> </li>
    <li><?php echo $this->Html->link(__('New Vehicle'), array('controller' => 'vehicles', 'action' => 'add')); ?> </li>
  </ul>
</div>
<div class="related">
  <br>
  <hr >
  <h1><?php echo __('Acoplados de la Transporte "').h($company['Company']['social_razon']).'"'; ?></h1>
  <?php if (!empty($company['Coupled'])): ?>
    <table cellpadding = "0" cellspacing = "0">
      <tr>
        <th><?php echo __('Modelo'); ?></th>
        <th><?php echo __('Patente'); ?></th>
        <th><?php echo __('Descripcion'); ?></th>
        <th class="actions"><?php echo __('Actions'); ?></th>
      </tr>
      <?php
      $i = 0;
      foreach ($company['Coupled'] as $coupled):
        ?>
        <tr>
          <td><?php echo $coupled['model']; ?></td>
          <td><?php echo $coupled['domain']; ?></td>
          <td><?php echo $coupled['description']; ?></td>
          <td class="actions">
            <?php echo $this->Html->link(__('Editar'), array('controller' => 'coupleds', 'action' => 'edit', $coupled['id'])); ?>
    <?php echo $this->Form->postLink(__('Borrar'), array('controller' => 'coupleds', 'action' => 'delete', $coupled['id']), null, __('Are you sure you want to delete # %s?', $coupled['id'])); ?>
          </td>
        </tr>
    <?php endforeach; ?>
    </table>
<?php endif; ?>

<!--  <div class="actions">
    <ul>
      <li><?php // echo $this->Html->link(__('Nuevo Acoplado'), array('controller' => 'coupleds', 'action' => 'add')); ?> </li>
    </ul>
  </div>-->
</div>
<div class="related">
   <br>
  <hr>
  <h1><?php echo __('Choferes de la Transporte "').h($company['Company']['social_razon']).'"'; ?></h1>
<?php if (!empty($company['Driver'])): ?>
    <table cellpadding = "0" cellspacing = "0">
      <tr>
        <th><?php echo __('Nombre'); ?></th>
        <th><?php echo __('Dni'); ?></th>
        <th><?php echo __('Cuil'); ?></th>
        <th><?php echo __('Email'); ?></th>
        <th><?php echo __('Telefono'); ?></th>
        <th><?php echo __('Ciudad'); ?></th>
        <th class="actions"><?php echo __('Actions'); ?></th>
      </tr>
      <?php
      $i = 0;
      foreach ($company['Driver'] as $driver):
        ?>
        <tr>
          <td><?php echo $driver['name']; ?></td>
          <td><?php echo $driver['dni']; ?></td>
          <td><?php echo $driver['cuil']; ?></td>
          <td><?php echo $driver['email']; ?></td>
          <td><?php echo $driver['phone']; ?></td>
          <td><?php echo $driver['city']; ?></td>
          <td class="actions">
    <?php echo $this->Html->link(__('Editar'), array('controller' => 'drivers', 'action' => 'edit', $driver['id'])); ?>
        <?php echo $this->Form->postLink(__('Borrar'), array('controller' => 'drivers', 'action' => 'delete', $driver['id']), null, __('Are you sure you want to delete # %s?', $driver['id'])); ?>
          </td>
        </tr>
    <?php endforeach; ?>
    </table>
<?php endif; ?>

<!--  <div class="actions">
    <ul>
      <li><?php // echo $this->Html->link(__('Nuevo Chofer'), array('controller' => 'drivers', 'action' => 'add')); ?> </li>
    </ul>
  </div>
</div>-->
<div class="related">
   <br>
  <hr>
  <h1><?php echo __('Ordenes Despachadas con el Transporte "').h($company['Company']['social_razon']).'"'; ?></h1>
<?php if (!empty($company['Order'])): ?>
    <table cellpadding = "0" cellspacing = "0">
      <tr>
        <th><?php echo __('Origen'); ?></th>
        <th><?php echo __('Destino'); ?></th>
        <th><?php echo __('Fecha'); ?></th>
        <th class="actions"><?php echo __('Actions'); ?></th>
      </tr>
      <?php
      $i = 0;
      foreach ($company['Order'] as $order):
        ?>
        <tr>
          <td><?php echo $order['origin']; ?></td>
          <td><?php echo $order['destination']; ?></td>
          <td><?php echo $order['date']; ?></td>
          <td class="actions">
    <?php echo $this->Html->link(__('Ver'), array('controller' => 'orders', 'action' => 'view', $order['id'])); ?>
        <?php echo $this->Html->link(__('Editar'), array('controller' => 'orders', 'action' => 'edit', $order['id'])); ?>
        <?php echo $this->Form->postLink(__('Borrar'), array('controller' => 'orders', 'action' => 'delete', $order['id']), null, __('Are you sure you want to delete # %s?', $order['id'])); ?>
          </td>
        </tr>
  <?php endforeach; ?>
    </table>
<?php endif; ?>

<!--  <div class="actions">
    <ul>
      <li><?php // echo $this->Html->link(__('Crear Orden'), array('controller' => 'orders', 'action' => 'add')); ?> </li>
    </ul>
  </div>-->
</div>
<div class="related">
   <br>
  <hr>
  <h1><?php echo __('Camiones del Transporte "').h($company['Company']['social_razon']).'"'; ?></h1>
<?php if (!empty($company['Vehicle'])): ?>
    <table cellpadding = "0" cellspacing = "0">
      <tr>
        <th><?php echo __('Modelo'); ?></th>
        <th><?php echo __('Patente'); ?></th>
        <th><?php echo __('Descripcion'); ?></th>
        <th class="actions"><?php echo __('Actions'); ?></th>
      </tr>
  <?php
  $i = 0;
  foreach ($company['Vehicle'] as $vehicle):
    ?>
        <tr>
          <td><?php echo $vehicle['model']; ?></td>
          <td><?php echo $vehicle['domain']; ?></td>
          <td><?php echo $vehicle['description']; ?></td>
          <td class="actions">
        <?php echo $this->Html->link(__('Ver'), array('controller' => 'vehicles', 'action' => 'view', $vehicle['id'])); ?>
        <?php echo $this->Html->link(__('Editar'), array('controller' => 'vehicles', 'action' => 'edit', $vehicle['id'])); ?>
      <?php echo $this->Form->postLink(__('Borrar'), array('controller' => 'vehicles', 'action' => 'delete', $vehicle['id']), null, __('Are you sure you want to delete # %s?', $vehicle['id'])); ?>
          </td>
        </tr>
  <?php endforeach; ?>
    </table>
<?php endif; ?>

<!--  <div class="actions">
    <ul>
      <li><?php // echo $this->H
      //tml->link(__('Nuevo Camion'), array('controller' => 'vehicles', 'action' => 'add')); ?> </li>
    </ul>
  </div>-->
</div>
